{{/*
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright (c) 2021-present Kaleidos Ventures SL
*/}}

{{ define "main" }}

<!-- blog post -->
<section class="section-sm">
  <div class="container">
    <div class="row">
      <div class="col-lg-8 mb-5 mb-lg-0">
        <div class="row">
          {{ $var := delimit (slice .URL) "/" }}
          {{ if eq $var "/categories/" }}
            {{ $paginator := .Paginate (where .Data.Pages "Type" "!=" "faq") }}
            {{ range sort $paginator.Pages ".Params.order" }}
              {{ .Render "categories" }}
            {{ end }}
          {{ else }}
            {{ $paginator := .Paginate (where .Data.Pages "Type" "!=" "faq") }}
            {{ range sort $paginator.Pages ".Params.order" }}
              {{ .Render "post" }}
            {{ end }}
          {{ end }}
        </div>
      </div>
      <!-- sidebar -->
      {{ partial "sidebar.html" . }}
      <!-- /sidebar -->

      <!-- pagination -->
      <div class="col-12 mt-5">
        {{ template "_internal/pagination.html" . }}
      </div>
    </div>
  </div>
</section>
<!-- /blog post -->

{{ end }}
